import { makeAutoObservable } from "mobx";
import http from "../services/service";
class Store {
  value;
  constructor(value) {
    makeAutoObservable(this);
  }
  user = JSON.parse(sessionStorage.getItem("user")) || [];

  isVisible = false;
  isAddModalVisible = false;
  allSets = [];
  singleCheckItem = [];

  setUser(arr) {
    this.user = arr;
  }

  showModal = () => {
    this.isVisible = !this.isVisible;
  };

  showAddModal = () => {
    this.isAddModalVisible = !this.isAddModalVisible;
  };

  //get all sets
  getAllSets = (props) => {
    this.allSets = props;
  };

  getsingleCheckItem = (item) => {
    this.singleCheckItem = item;
  };
}

const store = new Store();
export default store;
